<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8" />
<link href="../css/docs.css" type="text/css" rel="stylesheet" />
<link href="../css/prettify.css" type="text/css" rel="stylesheet" />
<script src="../js/prettify.js" type="text/javascript"></script>
</head>
<body onLoad="prettyPrint()">
<div class="g-unit" id="doc-content">
<div id="api-info-block">
<div class="api-level">H3C CAS云管理平台</div>
</div>
<div id="jd-header">
<h1>增加主机</h1>
</div>
<div id="jd-content">
<div class="jd-descr">
<p>增加主机。</p>
<h2><a name="uri"></a>接口 URI</h2>
<p>/cas/casrs/host/add</p>
<h2><a name="access"></a>访问方法</h2>
<dl>
  <dt><b>HTTP 方法</b></dt>
  <dd>POST</dd>
  <dt><b>消息体</b></dt>
  <div class="source">
    <pre class="prettyprint lang-xml">&lt;host&gt;<br>&lt;user&gt;root&lt;/user&gt;<br>&lt;pwd&gt;1q2w3e&lt;/pwd&gt;<br>&lt;hostPoolId&gt;1&lt;/hostPoolId&gt;<br>&lt;clusterId&gt;4&lt;/clusterId&gt;<br>&lt;name&gt;192.168.10.80&lt;/name&gt;<br>&lt;enableHA&gt;1&lt;/enableHA&gt;<br>&lt;ignore&gt;false&lt;/ignore&gt;<br>&lt;/host&gt;</pre>
  </div>
</dl>
<dl>
  <dt><a name="detail"></a><b>元素含义</b></dt>
</dl>
<table id="pubmethods" class="jd-sumtable">
  <tbody>
    <tr>
      <th colspan="2"><span class="prettyprint lang-xml">host</span>各子元素</th>
    </tr>
    <tr>
      <td class="jd-typecol"><span class="prettyprint lang-xml"> user</span></td>
      <td width="100%" class="jd-linkcol"><span class="sympad">访问主机用户名。</span>
          <div class="jd-descrdiv">字符串（String）类型，必须。</div></td>
    </tr>
    <tr class="alt-color">
      <td class="jd-typecol"><span class="prettyprint lang-xml">pwd</span></td>
      <td class="jd-linkcol"><span class="sympad">访问主机密码。</span>
          <div class="jd-descrdiv">字符串（String）类型，必须。</div></td>
    </tr>
    <tr>
      <td class="jd-typecol"><span class="prettyprint lang-xml">hostPoolId</span></td>
      <td class="jd-linkcol"><span class="sympad">主机池ID。</span>
          <div class="jd-descrdiv">长整型（Iong）类型，必须。</div></td>
    </tr>
    <tr class="alt-color">
      <td class="jd-typecol"><span class="prettyprint lang-xml">clusterId</span></td>
      <td class="jd-linkcol"><span class="sympad">集群ID。</span>
          <div class="jd-descrdiv">长整型（Iong）类型，可选。</div></td>
    </tr>
    <tr>
      <td class="jd-typecol"><span class="prettyprint lang-xml">name</span></td>
      <td class="jd-linkcol"><span class="sympad"></span>服务器IP地址。
          <div class="jd-descrdiv">字符串（String）类型，必须。</div></td>
    </tr>
    <tr class="alt-color">
      <td class="jd-typecol"><span class="prettyprint lang-xml">enableHA</span></td>
      <td class="jd-linkcol"><p><span class="sympad">是否启用HA，1：启用，0：未启用</span>，结合clusterID使用。 </p>
        <div class="jd-descrdiv">整型（Integer）类型，必须。</div></td>
    </tr>
    <tr>
      <td class="jd-typecol"><span class="prettyprint lang-xml">ignore</span></td>
      <td class="jd-linkcol"><span class="sympad">是否忽略重复管理。</span>
          <div class="jd-descrdiv"> 布尔 （Boolean）类型，必须。</div></td>
    </tr>
</table>
<h2><a name="result"></a>返回结果</h2>
<dl>
  <dt><b>状态码</b></dt>
  <dd>
  <ul>
    <li>200(OK)：成功。</li>
  </ul>
  </dd>
  <dt><b>消息头</b><br>
  </dt>
  <pre class="prettyprint lang-xml">&lt;?xml version=&quot;1.0&quot; encoding=&quot;UTF-8&quot;?&gt;
&lt;taskMsg&gt;<br>  &lt;msgId&gt;1410943942346&lt;/msgId&gt;<br>  &lt;completed&gt;false&lt;/completed&gt;<br>  &lt;progress&gt;0&lt;/progress&gt;<br>  &lt;eventType&gt;0&lt;/eventType&gt;<br>&lt;/taskMsg&gt;</pre>
</dl>

<dl>
  <dt><a name="detail"></a><b>元素含义</b></dt>
</dl>
<table id="pubmethods" class="jd-sumtable">
  <tbody>
    <tr>
      <th colspan="2">返回增加主机任务id，可根据任务id查询任务进度。</th>
    </tr>
</table>
<h2><a name="example"></a>应用举例</h2>
    <p>1.增加IP为“192.168.10.80”的主机。</p>
    <dl>
      <dt><b>请求</b></dt>
      <div class="source">
        <pre class="prettyprint lang-xml">POST http://localhost:8080/cas/casrs/host/add
accept: application/xml


&lt;host&gt;<br>&lt;user&gt;root&lt;/user&gt;<br>&lt;pwd&gt;1q2w3e&lt;/pwd&gt;<br>&lt;hostPoolId&gt;1&lt;/hostPoolId&gt;<br>&lt;name&gt;192.168.10.80&lt;/name&gt;<br>&lt;enableHA&gt;1&lt;/enableHA&gt;<br>&lt;ignore&gt;false&lt;/ignore&gt;<br>&lt;/host&gt;
</pre>
      </div>
      <dt><b>回应</b></dt>
      <div class="source"><pre class="prettyprint lang-xml">HTTP/1.1 200 OK<br>Set-Cookie: JSESSIONID=06A0274E8DF6F83891933D8648B28952; Path=/cas<br>Content-Type: application/xml<br>Content-Length: 176<br>Date: Wed, 17 Sep 2014 09:27:19 GMT<br>
&lt;?xml version=&quot;1.0&quot; encoding=&quot;UTF-8&quot;?&gt;&lt;taskMsg&gt;<br>  &lt;msgId&gt;1410943942346&lt;/msgId&gt;<br>  &lt;completed&gt;false&lt;/completed&gt;<br>  &lt;progress&gt;0&lt;/progress&gt;<br>  &lt;eventType&gt;0&lt;/eventType&gt;<br>&lt;/taskMsg&gt;<br></pre>
      </div>
    </dl>
</div>
</div>
</div>
</body>
</html>